package ran.quzitech.rnutils.manager;

import android.content.Context;
import android.util.Log;

import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;

import ran.quzitech.rnutils.tts.SpeechUtilOffline;


/**
 * Created by Administrator on 2016/12/2 0002.
 */
public class TextToSpeechManager extends ReactContextBaseJavaModule {

    private Context context;
    private ReactContext reactContext;

    private static final String LOG_TAG = "snooker_TTSManager";


    @Override
    public String getName() {
        return "TextToSpeechManager";
    }

    public TextToSpeechManager(ReactApplicationContext reactContext) {
        super(reactContext);
        context = reactContext;
        this.reactContext = reactContext;

//       * offline.play(mTTSText.getText().toString());
//       * offline.stop();
//       *

    }

    @ReactMethod
    public void textToSpeechWithCallback(String text, Callback callback) {

        Log.v(LOG_TAG, "before authorize");
        SpeechUtilOffline.play(text);
    }

}
